package net.stogi.common.gwt.dispatch.server.core;

import net.stogi.common.gwt.dispatch.shared.core.Action;
import net.stogi.common.gwt.dispatch.shared.core.Result;

public interface ActionHandlerRegistry<A extends Action<R>, R extends Result> {

	/**
	 * Clears all registered handlers from the registry.
	 */
	void clearHandlers();

	/**
	 * Searches the registry and returns the first handler which supports the
	 * specied action, or <code>null</code> if none is available.
	 * 
	 * @param action
	 *            The action.
	 * @return The handler.
	 */
	ActionHandler<A, R> findHandler(A action);
}
